package org.or5e.service.core.sm;

import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;

public class DAOSessionImpl implements DAOSession {
	private Map<String, Object> sessionMap = new HashMap<String, Object>();
	private Calendar createdDate = Calendar.getInstance();
	
	public Calendar getCreatedDate() {
		return createdDate;
	}

	public void accesedNow() {
		this.createdDate = null;
		this.createdDate = Calendar.getInstance();
	}

	@Override
	public Object get(String key) {
		return sessionMap.get(key);
	}

	@Override
	public void put(String key, Object value) {
		this.sessionMap.put(key, value);
	}
	
	@Override
	public void remove(String key) {
		this.sessionMap.remove(key);
	}

	@Override
	public void destroy() {
		this.sessionMap.clear();
		this.sessionMap = null;
	}
}